package com.ruoyi.monitor.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.monitor.mapper.MonitorMaintenanceRecordMapper;
import com.ruoyi.monitor.domain.MonitorMaintenanceRecord;
import com.ruoyi.monitor.service.IMonitorMaintenanceRecordService;

/**
 * 设备维修记录Service业务层处理
 * 
 * @author lh
 * @date 2025-04-16
 */
@Service
public class MonitorMaintenanceRecordServiceImpl implements IMonitorMaintenanceRecordService 
{
    @Autowired
    private MonitorMaintenanceRecordMapper monitorMaintenanceRecordMapper;

    /**
     * 查询设备维修记录
     * 
     * @param recordId 设备维修记录主键
     * @return 设备维修记录
     */
    @Override
    public MonitorMaintenanceRecord selectMonitorMaintenanceRecordByRecordId(Integer recordId)
    {
        return monitorMaintenanceRecordMapper.selectMonitorMaintenanceRecordByRecordId(recordId);
    }

    /**
     * 查询设备维修记录列表
     * 
     * @param monitorMaintenanceRecord 设备维修记录
     * @return 设备维修记录
     */
    @Override
    public List<MonitorMaintenanceRecord> selectMonitorMaintenanceRecordList(MonitorMaintenanceRecord monitorMaintenanceRecord)
    {
        return monitorMaintenanceRecordMapper.selectMonitorMaintenanceRecordList(monitorMaintenanceRecord);
    }

    /**
     * 新增设备维修记录
     * 
     * @param monitorMaintenanceRecord 设备维修记录
     * @return 结果
     */
    @Override
    public int insertMonitorMaintenanceRecord(MonitorMaintenanceRecord monitorMaintenanceRecord)
    {
        monitorMaintenanceRecord.setCreateTime(DateUtils.getNowDate());
        return monitorMaintenanceRecordMapper.insertMonitorMaintenanceRecord(monitorMaintenanceRecord);
    }

    /**
     * 修改设备维修记录
     * 
     * @param monitorMaintenanceRecord 设备维修记录
     * @return 结果
     */
    @Override
    public int updateMonitorMaintenanceRecord(MonitorMaintenanceRecord monitorMaintenanceRecord)
    {
        return monitorMaintenanceRecordMapper.updateMonitorMaintenanceRecord(monitorMaintenanceRecord);
    }

    /**
     * 批量删除设备维修记录
     * 
     * @param recordIds 需要删除的设备维修记录主键
     * @return 结果
     */
    @Override
    public int deleteMonitorMaintenanceRecordByRecordIds(Integer[] recordIds)
    {
        return monitorMaintenanceRecordMapper.deleteMonitorMaintenanceRecordByRecordIds(recordIds);
    }

    /**
     * 删除设备维修记录信息
     * 
     * @param recordId 设备维修记录主键
     * @return 结果
     */
    @Override
    public int deleteMonitorMaintenanceRecordByRecordId(Integer recordId)
    {
        return monitorMaintenanceRecordMapper.deleteMonitorMaintenanceRecordByRecordId(recordId);
    }
}
